package com.mico.example.springboot.mybatis.multi.dao.secondary;

import com.mico.example.springboot.mybatis.multi.domain.secondary.City;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

public interface CityMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table City
     *
     * @mbg.generated Thu Mar 07 11:09:01 CST 2019
     */
    @Delete({
        "delete from City",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table City
     *
     * @mbg.generated Thu Mar 07 11:09:01 CST 2019
     */
    @Insert({
        "insert into City (id, city, ",
        "province)",
        "values (#{id,jdbcType=INTEGER}, #{city,jdbcType=VARCHAR}, ",
        "#{province,jdbcType=VARCHAR})"
    })
    int insert(City record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table City
     *
     * @mbg.generated Thu Mar 07 11:09:01 CST 2019
     */
    @Select({
        "select",
        "id, city, province",
        "from City",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR)
    })
    City selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table City
     *
     * @mbg.generated Thu Mar 07 11:09:01 CST 2019
     */
    @Select({
        "select",
        "id, city, province",
        "from City"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR)
    })
    List<City> selectAll();

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table City
     *
     * @mbg.generated Thu Mar 07 11:09:01 CST 2019
     */
    @Update({
        "update City",
        "set city = #{city,jdbcType=VARCHAR},",
          "province = #{province,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(City record);
}